
$('input').focus(function(){
	$(this).val('').css('color','#333');
});
/*手机*/

$('.shouji').focus(function(){
	$('.shouji').css('color',"#333").val('');
});
$('.wenbenyu').focus(function(){
	$(this).val('').css('color','#333');
})
$('.shouji').blur(function(){
	
	var zh=$(this).val();
	var reg=/^1[34578]\d{9}$/;
	var res=reg.test(zh);

	if(!res){
		alert('手机格式有误');
	}
	if(zh===''){
		$('.shouji').val('手机号码')
	}

});

$('#location').click(function(){
	// $('#location').css('overflow','hidden');
	$('.chatupian').empty();
})
window.onload=function(){
	var rjx = $('.chatupian').children().length;
	if(rjx==0){
		$('.dizhi-jiaobu').css('background-image','../img/beijing@2x.png');
	}else{
		$('.dizhi-jiaobu').css('background-image','none');
	}	
}
var oIpt1=document.querySelector(".ipt1");

var oIpt2=document.querySelector(".ipt2");

var oIpt3=document.querySelector(".ipt3");


var fcanshu =  window.location.search.substring(1);
console.log(fcanshu);
/*判断是否从物流页面跳过来*/
/*if(fcanshu=='wu=1'){
	$('.btn').css('display','none');
	$('.btn1').css('display','block');
	$('.btn2').css('display','none');
}else if(fcanshu=='wu=2'){
	$('.btn').css('display','none');
	$('.btn1').css('display','block');
	$('.btn2').css('display','none');
	
}else if(fcanshu=='qu=1'){
	$('.btn').css('display','none');
	$('.btn2').css('display','block');
	$('.btn1').css('display','none');
}else{
	$('.btn').css('display','block');
	$('.btn1').css('display','none');
	$('.btn2').css('display','none');
}*/
function wuliuadd(){
	if(fcanshu=='wu=1'){
		var g=localStorage;
		g.setItem('fname',oIpt1.value);
		g.setItem('fdianhua',oIpt2.value);
		g.setItem('fxinxi',oIpt3.value);
		g.setItem('fxxxx',oIpt4.value);
	}else if(fcanshu=='wu=2'){
		var g=localStorage;
		g.setItem('name',oIpt1.value);
		g.setItem('dianhua',oIpt2.value);
		g.setItem('xinxi',oIpt3.value);
		g.setItem('xxxx',oIpt4.value);
	}
}
/*function qukuaidiadd(){
	if(fcanshu=='qu=1'){
		var g=localStorage;
		g.setItem('fname',oIpt1.value);
		g.setItem('fdianhua',oIpt2.value);
		g.setItem('fxinxi',oIpt3.value);
	}
}*/
/*判断是否从物流页面跳过来*/
/*判断是否从取快递页面跳过来*/

/*判断是否从取快递页面跳过来*/
/*function add(){

	if(fcanshu=='path=1'){
		var g=localStorage;
		g.setItem('fname',oIpt1.value);
		g.setItem('fdianhua',oIpt2.value);
		g.setItem('fxinxi',oIpt3.value);
	}else if(fcanshu=='path=2'){
		var g=localStorage;
		g.setItem('name',oIpt1.value);
		g.setItem('dianhua',oIpt2.value);
		g.setItem('xinxi',oIpt3.value);
	}
}*/

var sg=document.querySelector(".rjx-shangguan");
var dh=document.querySelector(".rjx-dianhua");
var dz=document.querySelector(".rjx-dizhi");

$('.chatupian li').each(function(index,item){
	console.log(item,index);
	$(item).attr('index',index).click(function(){
		
		var g=localStorage;
	 	
		window.open('../wuliutuoyun/wu.html?path=3');
		if(fcanshu=='path=1'){
			g.setItem('fRjxName1',$(this).find('.rjx-shangguan').val());
			g.setItem('fRjxDianhua1',$(this).find('.rjx-dianhua').val());
			g.setItem('fRjxDizhi1',$(this).find('.rjx-dizhi').text());	
		}else{
			g.setItem('sRjxName2',$(this).find('.rjx-shangguan').val());
			g.setItem('sRjxDianhua2',$(this).find('.rjx-dianhua').val());
			g.setItem('sRjxDizhi2',$(this).find('.rjx-dizhi').text());
		}
	});

})

